﻿<UserControl x:Class="Rifts.Controls.CharacterSheetPage1"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:l="clr-namespace:Rifts.Controls"
			 xmlns:sys="clr-namespace:System;assembly=mscorlib"
			 mc:Ignorable="d" 
			 Width="768"
			 Height="960"
			 >
	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/Granite.Xaml;component/ConvertersList.xaml" />
				<ResourceDictionary Source="/Assets/Styles.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

	<Border BorderBrush="Black" BorderThickness="2">
		<StackPanel>
			<l:SectionPanel Header="Character Data">
				<StackPanel>
					<StackPanel Orientation="Horizontal" >
						<l:GroupPanel Header="Character"  Width="640" Padding="4">
							<StackPanel>
								<StackPanel Orientation="Horizontal" >
									<l:LabeledTextBlock Header="Name" Text="{Binding Name}" Width="300"  />
									<l:LabeledTextBlock Header="Alias" Text="{Binding Alias}" Width="300"/>
								</StackPanel>

								<StackPanel Orientation="Horizontal" l:LabeledTextBlock.TextWidth="155">
									<l:LabeledTextBlock Header="Race" Text="{Binding Race}"  />
									<l:LabeledTextBlock Header="Class" Text="{Binding Class}"  />
									<l:LabeledTextBlock Header="Alignment" Text="{Binding Alignment}" />
								</StackPanel>

								<StackPanel Orientation="Horizontal" >
									<l:LabeledTextBlock Header="Sex" Text="{Binding Sex}" TextWidth="48" />
									<l:LabeledTextBlock Header="Age" Text="{Binding Age}" TextWidth="24" />
									<l:LabeledTextBlock Header="Height" Text="{Binding Height}" TextWidth="48" />
									<l:LabeledTextBlock Header="Weight" Text="{Binding Weight}" TextWidth="48" />
									<l:LabeledTextBlock Header="Homeland" Text="{Binding Homeland}" TextWidth="325" />
								</StackPanel>

								<l:LabeledTextBlock Header="Traits" Text="{Binding Traits}" Width="600" HorizontalAlignment="Left" />
								<l:LabeledTextBlock Header="Insanities/Obsessions" Text="{Binding Insanities}" Width="600" HorizontalAlignment="Left"/>


								<StackPanel Orientation="Horizontal" l:LabeledTextBlock.TextWidth="48">
									<TextBlock Text="Invoke >>" />
									<l:LabeledTextBlock Header="Trust" Text="{Binding Trust, StringFormat={}{0}\%}"/>
									<l:LabeledTextBlock Header="Intimidate" Text="{Binding Intimidate, StringFormat={}{0}\%}"/>
									<l:LabeledTextBlock Header="Charm" Text="{Binding Charm, StringFormat={}{0}\%}"/>
									<l:LabeledTextBlock Header="Impress" Text="{Binding Impress, StringFormat={}{0}\%}"/>
									<l:LabeledTextBlock Header="Awe" Text="{Binding Awe}"/>
									<l:LabeledTextBlock Header="Horror" Text="{Binding HF}"/>
								</StackPanel>

							</StackPanel>

						</l:GroupPanel>
						<l:GroupPanel  Header="Experience" Width="120" Padding="4" l:LabeledTextBlock.TextWidth="72" l:LabeledTextBlock.Orientation="Vertical" HeaderFontSize="7">
							<StackPanel>
								<l:LabeledTextBlock Header="Level" Text="{Binding Level}" TextWidth="24" />
								<l:LabeledTextBlock Header="Experience" Text="{Binding Experience}" />
								<l:LabeledTextBlock Header="Next Level At" Text="{Binding ExperienceNextLevel}" />
							</StackPanel>
						</l:GroupPanel>
					</StackPanel>

					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>


						<l:GroupPanel Header="Stats" Grid.RowSpan="2" Padding="4" HeaderFontSize="14" >
							<StackPanel l:LabeledTextBlock.TextWidth="24">

								<l:LabeledTextBlock HeaderWidth="35" Header="I.Q." Text="{Binding IQ}" >
									<StackPanel Orientation="Horizontal" l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Perception " Text="{Binding PerceptionFromIQ, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Skill " Text="{Binding SkillBonusFromIQ, StringFormat={}{0}\%}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Illusions " Text="{Binding IllusionSaveFromIQ, StringFormat={StaticResource BonusFormat}}" />
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="M.E." Text="{Binding ME}"  >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Mental" Text="{Binding PsionicSaveFromME, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Insainity" Text="{Binding InsainitySaveFromIQ, StringFormat={StaticResource BonusFormat}}" />
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="M.A." Text="{Binding MA}"  >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Trust" Text="{Binding TrustFromMA, StringFormat={}{0}\%}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Intimidate " Text="{Binding IntimidateFromMA, StringFormat={}{0}\%}" />
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="P.S." Text="{Binding PS}"  >
									<StackPanel Orientation="Horizontal" l:LabeledTextBlock.HeaderWidth="NaN" >
										<l:LabeledTextBlock HeaderFontSize="10" Header="Damage" Text="{Binding DamageFromPS, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Type" Text="{Binding PSType}" TextWidth="48" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Lift" Text="{Binding Lift}" TextWidth="48" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Carry" Text="{Binding Carry}" TextWidth="48" />
									</StackPanel>
								</l:LabeledTextBlock>


								<l:LabeledTextBlock HeaderWidth="35" Header="P.P." Text="{Binding PP}"  >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Parry/Dodge" Text="{Binding ParryDodgeFromPP, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Strike" Text="{Binding StrikeFromPP, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Initiative" Text="{Binding InitiativeFromPP, StringFormat={StaticResource BonusFormat}}" />
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="P.E." Text="{Binding PE}"  >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="8" Header="Magic/Poison" Text="{Binding SaveFromPE, StringFormat={StaticResource BonusFormat}}" />
										<l:LabeledTextBlock HeaderFontSize="8" Header="Death/Coma" Text="{Binding SaveFromPE2, StringFormat={}{0}\%}" />
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="P.B." Text="{Binding PB}"  >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Charm/Impress" Text="{Binding CharmFromPB, StringFormat={}{0}\%}" />
									</StackPanel>
								</l:LabeledTextBlock>


								<l:LabeledTextBlock HeaderWidth="35" Header="Spd." Text="{Binding Spd}" >
									<StackPanel Orientation="Horizontal" l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Mph: " Text="{Binding MilesPerHour, StringFormat={}{0:0.0}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Feet per Turn: " Text="{Binding FeetPerTurn}" />
										<!--<l:LabeledTextBlock HeaderFontSize="10" Header="Feet per Action: " Text="{Binding FeetPerAction}" />-->
									</StackPanel>
								</l:LabeledTextBlock>

								<l:LabeledTextBlock HeaderWidth="35" Header="Flying Spd." Text="{Binding FlyingSpd}" Visibility="{Binding FlyingSpd, Converter={StaticResource NotNullToVisibleConverter}}" >
									<StackPanel Orientation="Horizontal"  l:LabeledTextBlock.HeaderWidth="NaN">
										<l:LabeledTextBlock HeaderFontSize="10" Header="Mph: " Text="{Binding FlyingMilesPerHour, StringFormat={}{0:0.0}}" />
										<l:LabeledTextBlock HeaderFontSize="10" Header="Feet per Turn: " Text="{Binding FlyingFeetPerTurn}" />
										<!--<l:LabeledTextBlock HeaderFontSize="10" Header="Feet per Action: " Text="{Binding FlyingFeetPerAction}" />-->
									</StackPanel>
								</l:LabeledTextBlock>

							</StackPanel>
						</l:GroupPanel>
						<l:GroupPanel Header="Health" Grid.Column="1" Grid.Row="0" />
						<l:GroupPanel Header="Power" Grid.Column="1" Grid.Row="1" />


					</Grid>
				</StackPanel>


			</l:SectionPanel>
			<l:SectionPanel DataContext="{Binding FightingStyles.Primary}" Header="Fighting Style: Primary" Visibility="{Binding Converter={StaticResource NotNullToVisibleConverter}}">
				<l:FightingStyle/>
			</l:SectionPanel>



			<l:SectionPanel Header="Combat">
				<StackPanel>

					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<l:GroupPanel Header="Combat Abilities">
							<StackPanel>


								<ItemsControl ItemsSource="{Binding CombatAbilities}">
									<ItemsControl.ItemTemplate>
										<DataTemplate>
											<StackPanel>
												<Grid >
													<Grid.ColumnDefinitions>
														<ColumnDefinition Width="10"/>
														<ColumnDefinition Width="290"/>
														<ColumnDefinition Width="10"/>
														<ColumnDefinition Width="50"/>
													</Grid.ColumnDefinitions>
													<TextBlock Text="{Binding Name}" Width="290" Grid.Column="1" />
													<l:CalculatedTextBlock Text="{Binding Score, StringFormat={} {0}%}" Visibility="{Binding Score, Converter={StaticResource NotNullToVisibleConverter}}" Width="25" Grid.Column="3"/>
												</Grid>
												<TextBlock Text="{Binding BookReference}" Visibility="{Binding BookReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />
											</StackPanel>
										</DataTemplate>
									</ItemsControl.ItemTemplate>
								</ItemsControl>

							</StackPanel>
						</l:GroupPanel>
						<l:GroupPanel Header="Unarmed Attacks" Grid.Column="1">

						</l:GroupPanel>
					</Grid>
				</StackPanel>
				<!--<l:GroupPanel Header="Weapons" Grid.Column="1">
							<ItemsControl ItemsSource="{Binding Weapons}">
								<ItemsControl.ItemTemplate>
									<DataTemplate>
										<StackPanel Margin="10,0,0,0">
											<StackPanel Orientation="Horizontal">
												<TextBlock Width="225" Text="Weapon" />
												<TextBlock Width="25" Text="Strike" />
												<TextBlock Width="25" Text="Parry" />
												<TextBlock Width="75" Text="Damage" />
											</StackPanel>
											<Grid >
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="225"/>
													<ColumnDefinition Width="25"/>
													<ColumnDefinition Width="25"/>
													<ColumnDefinition Width="75"/>
												</Grid.ColumnDefinitions>
												<TextBlock Text="{Binding Name}" Width="225" Grid.Column="1" />

												<l:CalculatedTextBlock Text="{Binding Strike}" Visibility="{Binding Strike, Converter={StaticResource NotNullToVisibleConverter}}" Width="1" Grid.Column="3"/>
												<l:CalculatedTextBlock Text="{Binding Parry}" Visibility="{Binding Parry, Converter={StaticResource NotNullToVisibleConverter}}" Width="1" Grid.Column="3"/>
												<l:CalculatedTextBlock Text="{Binding Damage}" Visibility="{Binding Damage, Converter={StaticResource NotNullToVisibleConverter}}" Width="1" Grid.Column="3"/>
											</Grid>
											<StackPanel Orientation="Horizontal">
												<l:LabeledTextBlock Header="Range" Text="{Binding Ammo}" Visibility="{Binding Ammo, Converter={StaticResource NotZeroToVisibleConverter}}" Width="50"/>
												<l:LabeledTextBlock Header="Ammo" Text="{Binding Ammo}" Visibility="{Binding Ammo, Converter={StaticResource NotZeroToVisibleConverter}}" Width="100"/>
											</StackPanel>
											<TextBlock Text="{Binding BookReference}" Visibility="{Binding BookReference, Converter={StaticResource NotZeroToVisibleConverter}}"  FontStyle="Italic" />
										</StackPanel>
									</DataTemplate>
								</ItemsControl.ItemTemplate>
							</ItemsControl>
						</l:GroupPanel>-->
			</l:SectionPanel>
		</StackPanel>
	</Border>
</UserControl>
